package com.shanzmoo.stm.admin.domain.dto;

import cn.hutool.core.bean.BeanUtil;
import com.shanzmoo.db.stm.entity.StmSysRoleEntity;

import java.io.Serializable;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 仓储用户系统角色 保存对象
 *
 * @author Gzhao 2021-03-10
 */
@Data
@ApiModel("仓储用户系统角色-保存对象")
public class StmSysRoleSaveDTO implements Serializable {

    private static final long serialVersionUID = 1L;


    @NotBlank(message = "角色名不允许为空")
    @ApiModelProperty(value = "角色名", required = true)
    private String roleName;

    @NotBlank(message = "角色权限字符串不允许为空")
    @ApiModelProperty(value = "角色权限字符串", required = true)
    private String roleKey;

    @ApiModelProperty(value = "状态：1-启用，0-禁用", required = true)
    private Boolean status;

    @ApiModelProperty(value = "描述")
    private String description;

    @ApiModelProperty("菜单权限id列表" )
    private List<Integer> menuIds;

    public StmSysRoleEntity convertEntity() {
        StmSysRoleEntity target = new StmSysRoleEntity();
        BeanUtil.copyProperties(this, target, true);
        return target;
    }
}
